import { adminUrl } from "@/utils/baseUrl.js";
import request from "@/utils/request";

// 创建教学计划
export function createPlan(data) {
  return request({
    url: adminUrl + "/study/plan/create",
    method: "post",
    data: data,
  });
}

// 更新教学计划
export function updatePlan(data) {
  return request({
    url: adminUrl + "/study/plan/update",
    method: "put",
    data: data,
  });
}

// 删除教学计划
export function deletePlan(id) {
  return request({
    url: adminUrl + "/study/plan/delete?id=" + id,
    method: "delete",
  });
}

// 获得教学计划
export function getPlan(id) {
  return request({
    url: adminUrl + "/study/plan/get?id=" + id,
    method: "get",
  });
}

// 获得教学计划分页
export function getPlanPage(query) {
  return request({
    url: adminUrl + "/study/plan/page",
    method: "get",
    params: query,
  });
}

// 导出教学计划 Excel
export function exportPlanExcel(query) {
  return request({
    url: adminUrl + "/study/plan/export-excel",
    method: "get",
    params: query,
    responseType: "blob",
  });
}

// 根据学院教师管理列表
export function getTeacherList(query) {
  return request({
    url: adminUrl + "/collegebase/teacher-teachers/getByCollegeId",
    method: "get",
    params: query,
  });
}

// 获取所有课程
export function getClassList(query) {
  return request({
    url: adminUrl + "/study/subject/byFindStr/list",
    method: "get",
    params: query,
  });
}
